package com.zd.certificate.config;

public class DataSourceContextHolder {

    // 设置默认数据源
    private static final ThreadLocal<String> contextHolder = ThreadLocal.withInitial(()-> MultipleDataSourceConfig.PRIMARY_DS);

    public static void set(String dbType){
        contextHolder.set(dbType);
    }

    public static String get(){
        return contextHolder.get();
    }

    public static void clear(){
        contextHolder.remove();
    }
}
